# encoding=utf-8
import logging
import traceback

log_format_0 = "%(levelname)s %(asctime)s - %(message)s"
log_format = "【%(asctime)s】 【%(levelname)s】 >>>  %(message)s"


def log(path, data):
    logging.basicConfig(filename = path, filemode = "w", format = log_format, level = logging.ERROR, datefmt = '%Y-%m-%d %H:%M')
    logger = logging.getLogger()
    logger.error(data)
    logger.error("\n" + traceback.format_exc())


# log("log/time.log", "e")
